package leetcode;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

/**
 * @author Retain
 * @date 2021/7/20 21:03
 */
public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        HashSet<String> set = new HashSet<>();
        int left = 0;
        int right = 1;
        char pre = s.charAt(0);
        set.add(String.valueOf(pre));
        while (left <= right && right < s.length()) {
            if (pre != s.charAt(right)) {
                left = right;
                set.add(String.valueOf(right));
                pre = s.charAt(right);
                right++;
                continue;
            }
            set.add(s.substring(left, right));
            pre = s.charAt(right);
            right++;
        }
        System.out.println(set.size());
    }
}
